#!/usr/bin/node

const log = console.log,
      err = console.error;

const usr = process.argv[2],
      psw = process.argv[3],
      len = process.argv.length;

if(len!==4){
  err('命令行格式：cmd username password');
  process.exit(1);
}

log(`user name:${usr},password:${psw}`);

const buf = new Buffer(usr+':'+psw);
log(`buf:${buf}`);

log(`Base64:${buf.toString('Base64')}`);
